package team.seekers.hula.audit.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import team.seekers.hula.audit.entity.dto.CheckContentDTO;
import team.seekers.hula.audit.entity.dto.CheckPageQueryDTO;
import team.seekers.hula.audit.entity.dto.ReportPageQueryDTO;
import team.seekers.hula.audit.entity.dto.UpdateVisibilityDTO;
import team.seekers.hula.audit.entity.vo.CheckPageVO;
import team.seekers.hula.audit.entity.vo.ReportPageVO;
import team.seekers.hula.audit.service.AuditService;
import team.seekers.hula.common.annotation.ApiResponseBody;
import team.seekers.hula.common.entity.PageResult;

@Controller
@ApiResponseBody
@RequestMapping("/manage/audit")
public class AuditManageController {
    @Autowired
    private AuditService auditService;

    /**
     * 审核内容
     */
    @PostMapping("/checkContent")
    public void checkContent(@RequestBody CheckContentDTO checkContentDTO){
        auditService.checkContent(checkContentDTO);
    }

    /**
     * 内容等级变更
     */
    @PostMapping("/upgrade")
    public void upgrade(@RequestBody UpdateVisibilityDTO visibilityDTO){
        auditService.updateVisibility(visibilityDTO);
    }

    /**
     * 获取待审核列表
     */
    @GetMapping("/check/page")
    public PageResult<CheckPageVO> checkList(CheckPageQueryDTO queryDTO){
        return auditService.getCheckList(queryDTO);
    }

    /**
     * 获取举报列表
     */
    @GetMapping("/report/page")
    public PageResult<ReportPageVO> reportList(ReportPageQueryDTO queryDTO){
        return auditService.getReportList(queryDTO);
    }

}
